home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / snip1292.zip / C_PREC.TXT < prev    next >
Text File  |  1992-12-26  |  4KB  |  61 lines

  1.           Operator Precedence and Associativity Rules in C / C++
  2.  ============================================================================
  3.     ( )       function call                                 left-to-right
  4.     [ ]       array element
  5.      .        class, structure or union member
  6.     ->        pointer reference to member
  7.     ::        scope access / resolution (C++)
  8.  ----------------------------------------------------------------------------
  9.      !        logical not                                   right-to-left
  10.      ~        bitwise complement
  11.      -        unary minus
  12.      +        unary plus
  13.     ++        increment
  14.     --        decrement
  15.      &        address of
  16.      *        contents of
  17.   (type)      cast to type
  18.   sizeof      size in bytes
  19.     new       create object (C++)
  20.   delete      destroy object (C++)
  21.  ----------------------------------------------------------------------------
  22.     .*        member pointer (C++)                          left-to-right
  23.     ->*       pointer reference to member pointer (C++)
  24.  ----------------------------------------------------------------------------
  25.      *        multiply                                      left-to-right
  26.      /        divide
  27.      %        remainder
  28.  ----------------------------------------------------------------------------
  29.      +        add                                           left-to-right
  30.      -        subtract
  31.  ----------------------------------------------------------------------------
  32.     <<        bitwise left shift                            left-to-right
  33.     >>        bitwise right shift
  34.  ----------------------------------------------------------------------------
  35.      <        scalar less than                              left-to-right
  36.      >        scalar greater than
  37.     <=        scalar less than or equal to
  38.     >=        scalar greater than or equal to
  39.  ----------------------------------------------------------------------------
  40.     ==        scalar equal                                  left-to-right
  41.     !=        scalar not equal
  42.  ----------------------------------------------------------------------------
  43.      &        bitwise and                                   left-to-right
  44.  ----------------------------------------------------------------------------
  45.      ^        bitwise exclusive or                          left-to-right
  46.  ----------------------------------------------------------------------------
  47.      |        bitwise or                                    left-to-right
  48.  ----------------------------------------------------------------------------
  49.     &&        logical sequential and                        left-to-right
  50.  ----------------------------------------------------------------------------
  51.     ||        logical sequential or                         left-to-right
  52.  ----------------------------------------------------------------------------
  53.    ?  :       conditional expression                        right-to-left
  54.  ----------------------------------------------------------------------------
  55.      =        assignment operator                           right-to-left
  56.               also   +=    -=    *=    /=    %=
  57.                      &=    ^=    |=   >>=   <<=
  58.  ----------------------------------------------------------------------------
  59.      ,        sequential expression                         left-to-right
  60.  ----------------------------------------------------------------------------
  61.